<template>
  <div class="group-container">
    <div class="left">
      <template v-if="money">
        {{money / 100}}元
      </template>
      <template v-else> - </template>
    </div>
    <!-- <div> / </div>
    <div class="right">
      <template v-if="score">
        {{score}}积分
      </template>
      <template v-else> - </template>
    </div> -->

  </div>
</template>

<script>
	export default {
		props: {
			info: {
				type: Object,
				default () {
					return {}
				}
			},
      moneyKey: {
      	type: String
      },
      scoreKey: {
      	type: String
      },
      prefix: {
        type: String,
        default () {
          return ''
        }
      },
      linePrefix: {
        type: String,
        default () {
          return 'discount_'
        }
      }
		},
		filters: {},
    methods: {
      formatPrice(price) {
      	return (price / 100).toFixed(2)
      },
    },
		computed: {
			isHasDiscountPrice () {
				return (this.lineMoney || this.lineScore)
				&& (this.lineMoney != this.money || this.lineScore != this.score)
			},
      money () {
        return this.info[this.moneyKey || (this.prefix + 'money_price')]
      },
      score () {
        return this.info[this.scoreKey || (this.prefix + 'score_price')]
      },
      lineMoney () {
        return this.info[this.linePrefix + 'money_price']
      },
      lineScore () {
        return this.info[this.linePrefix + 'score_price']
      }
		}
	}
</script>

<style lang="scss" scoped>
  .group-container {
    display: flex;

    .left, .right {
      width: 80px;
      text-align: center;
    }
  }
</style>
